package com.weixin.paleituo.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.adapter.WuYeSelectRecycleAdapter;
import com.weixin.paleituo.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 选择房子
 */
public class SelectHouseActivity extends BaseActivity {

    @BindView(R.id.iv_back_activity_basepersoninfo)
    ImageView mIvBackActivityBasepersoninfo;
    @BindView(R.id.tv_title_activity_baseperson)
    TextView mTvTitleActivityBaseperson;
    @BindView(R.id.tv_small_title_layout_head)
    TextView mTvSmallTitleLayoutHead;
    @BindView(R.id.rl_head_root_activity_baseperson)
    RelativeLayout mRlHeadRootActivityBaseperson;
    @BindView(R.id.recycle_activity_select_house)
    RecyclerView mRecycleActivitySelectHouse;
    @BindView(R.id.tv_add_house_activity_select_house)
    TextView mTvAddHouseActivitySelectHouse;

    @Override
    protected void initView() {

        setContentView(R.layout.activity_select_house);
    }
    @Override
    protected void initData() {
        super.initData();
        mTvTitleActivityBaseperson.setText("请选择缴费房屋");

        List<String> stringList=new ArrayList<>();
        for (int i=0;i<20;i++){
            stringList.add(""+i);
        }

        WuYeSelectRecycleAdapter wuYeSelectRecycleAdapter=new WuYeSelectRecycleAdapter(this,stringList);

        mRecycleActivitySelectHouse.setAdapter(wuYeSelectRecycleAdapter);
        mRecycleActivitySelectHouse.setLayoutManager(new LinearLayoutManager(this));
        mRecycleActivitySelectHouse.setItemAnimator(new DefaultItemAnimator());

    }

    @OnClick(R.id.iv_back_activity_basepersoninfo)
    public void onMIvBackActivityBasepersoninfoClicked() {
        finish();
    }

    @OnClick(R.id.tv_add_house_activity_select_house)
    public void onMTvAddHouseActivitySelectHouseClicked() {
        BindHouseActivity.myStartActvity(this);


    }


    public static  void myStartActvity(Context context){
        Intent intent=new Intent(context,SelectHouseActivity.class);
        context.startActivity(intent);


    }
}
